import mysql.connector

mysqldb = mysql.connector.connect(
    host="192.168.3.55",
    port=3306,
    user="root",
    password="123456"
)

mycursor = mysqldb.cursor()

mycursor.execute("show databases")

for x in mycursor:
    print(x)